import {
  Column,
  CreateDateColumn,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

export abstract class BasicsEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @CreateDateColumn({
    comment: '创建时间',
  })
  createdAt: Date;

  @UpdateDateColumn({
    comment: '更新时间',
  })
  updatedAt: Date;
}

export abstract class CommonEntity extends BasicsEntity {
  @Column({ update: false, comment: '创建者' })
  createBy: number;

  @Column({ comment: '更新者' })
  updateBy: number;
}
